<%@ page language="java" pageEncoding="UTF-8"
	import="com.lyk.swap.orm.Product"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Add Future</title>

<link rel="stylesheet" type="text/css" href="ms.css">
<link rel="stylesheet" type="text/css" href="mshome.css">
<link rel="stylesheet" type="text/css" href="mstop.css">

<logic:notPresent name="userid" scope="session">
	<logic:redirect page="/user_error.jsp" />
</logic:notPresent>
<logic:notPresent name="productlist" scope="session">
	<logic:redirect page="/error.jsp" />
</logic:notPresent>
<logic:notPresent name="pllist" scope="session">
	<logic:redirect page="/error.jsp" />
</logic:notPresent>
</head>
<body>
	<center>
		<div class="n_topNavBg">
			<div class="n_topNav">
				<div id="topBanner">
					<div id="logoAndLinks">
						<a href="http://www.morganstanley.com" id="logo"> <img
							src="img/logo-ms.gif" border="0" alt="Morgan Stanley">
						</a>
						<div id="topNavMod">
							<div align="right"></div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="n_bnrContainer">
			<div class="n_bnrBg" id="n_bannerBg">
				<html:form action="/addFuture">
			product : <html:select property="product">
						<logic:iterate id="product" name="productlist" scope="session">
							<html:option value="<%=((Product) product).getCode()%>">
								<bean:write name="product" property="code" />
							</html:option>
						</logic:iterate>
					</html:select>
					<br />
			period : <html:select property="period" styleId="period">
						<logic:iterate id="pl" name="pllist" scope="session">
							<html:option value="0">
								<bean:write name="pl" />
							</html:option>
						</logic:iterate>
					</html:select>
					<br />
			buy/sell : <html:select property="buy">
						<html:option value="true">BUY</html:option>
						<html:option value="false">SELL</html:option>
					</html:select>
					<br />
			price : <html:text property="price" />
					<html:errors property="price" />
					<br />
			quantity : <html:text property="quantity" />
					<html:errors property="quantity" />
					<br />
					<html:submit />
					<html:cancel />
				</html:form>
				<script type="text/javascript">
					var period = document.getElementById("period");
					for ( var i = 0; i < period.options.length; i++) {
						period.options[i].value = i;
					}
				</script>
			</div>
		</div>
		<div class="n_footerBg" id="footer">
			<div class="n_footer">By ISAD-SJTU. Author Yizhi Gu, Yunkai Luo and Rui Shi.</div>
		</div>
	</center>
</body>
</html>

